//
//  ViewController.m
//  2.19
//
//  Created by student on 16/2/19.
//  Copyright © 2016年 niit. All rights reserved.
//

#import "ViewController.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


- (IBAction)backTap:(id)sender
{

    [self.name resignFirstResponder];
    [self.age resignFirstResponder];
    [self.classroom resignFirstResponder];
}



- (IBAction)click:(UIButton *)sender
{
    NSString *str=self.moBan.text;
    NSMutableString *mstr= [str mutableCopy];
    NSRange rang1=[mstr rangeOfString:@"<name>"];
    while (rang1.location!=NSNotFound) {
        [mstr replaceCharactersInRange:rang1 withString:self.name.text];
        rang1=[mstr rangeOfString:@"<name>"];
    }
    NSRange rang2=[mstr rangeOfString:@"<age>"];
    while (rang2.location!=NSNotFound) {
        [mstr replaceCharactersInRange:rang2 withString:self.age.text];
        rang2=[mstr rangeOfString:@"<age>"];
    }
    NSRange rang3=[mstr rangeOfString:@"<classroom>"];
    while (rang3.location!=NSNotFound) {
        [mstr replaceCharactersInRange:rang3 withString:self.classroom.text];
        rang3=[mstr rangeOfString:@"<classroom>"];
    }

    self.show.text=mstr;




}
@end
